﻿<%@ Page Language="C#" MasterPageFile="~/Home.master" AutoEventWireup="true"
   CodeFile="Register.aspx.cs" Inherits="KimSoft.UI.Register" Title="Đăng ký" %>
<%@ Register Src="Controls/UserProfile.ascx" TagName="UserProfile" TagPrefix="mb" %>

<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="Server">
   <asp:CreateUserWizard runat="server" ID="CreateUserWizard1" AutoGeneratePassword="False" CreateUserButtonText="Tạo tài khoản"
      ContinueDestinationPageUrl="~/Default.aspx" FinishDestinationPageUrl="~/Default.aspx" OnFinishButtonClick="CreateUserWizard1_FinishButtonClick" OnCreatedUser="CreateUserWizard1_CreatedUser">
      <WizardSteps>
         <asp:CreateUserWizardStep runat="server">
            <ContentTemplate>
            <div class="sectiontitle">Thông tin tài khoản</div>
            <p></p>
            <table cellpadding="2">
               <tr>
                  <td style="width: 130px;" class="fieldname"><asp:Label runat="server" ID="lblUserName" AssociatedControlID="UserName" Text="Username(*):" /></td>
                  <td style="width: 300px;"><asp:TextBox runat="server" ID="UserName" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireUserName" runat="server" ControlToValidate="UserName" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="B&#7855;t bu&#7897;c nh&#7853;p Username." ToolTip="B&#7855;t bu&#7897;c nh&#7853;p Username." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                  </td>            
               </tr>               
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblPassword" AssociatedControlID="Password" Text="M&#7853;t kh&#7849;u(*):" /></td>
                  <td><asp:TextBox runat="server" ID="Password" TextMode="Password" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequirePassword" runat="server" ControlToValidate="Password" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="B&#7855;t bu&#7897;c nh&#7853;p m&#7853;t kh&#7849;u." ToolTip="B&#7855;t bu&#7897;c nh&#7853;p m&#7853;t kh&#7849;u." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                     <asp:RegularExpressionValidator ID="valPasswordLength" runat="server" ControlToValidate="Password" SetFocusOnError="true" Display="Dynamic"
                        ValidationExpression="\w{5,}" ErrorMessage="M&#7853;t kh&#7849;u ít nh&#7845;t 5 ký t&#7921;." ToolTip="M&#7853;t kh&#7849;u ít nh&#7845;t 5 ký t&#7921;."
                        ValidationGroup="CreateUserWizard1">*</asp:RegularExpressionValidator>
                  </td>            
               </tr>
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblConfirmPassword" AssociatedControlID="ConfirmPassword" Text="M&#7853;t kh&#7849;u xác nh&#7853;n(*):" /></td>
                  <td><asp:TextBox runat="server" ID="ConfirmPassword" TextMode="Password" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireConfirmPassword" runat="server" ControlToValidate="ConfirmPassword" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="B&#7855;t bu&#7897;c nh&#7853;p m&#7853;t kh&#7849;u xác nh&#7853;n." ToolTip="B&#7855;t bu&#7897;c nh&#7853;p m&#7853;t kh&#7849;u xác nh&#7853;n."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                     <asp:CompareValidator ID="valComparePasswords" runat="server" ControlToCompare="Password" SetFocusOnError="true"
                        ControlToValidate="ConfirmPassword" Display="Dynamic" ErrorMessage="M&#7853;t kh&#7849;u và m&#7853;t kh&#7849;u xác nh&#7853;n không kh&#7899;p."
                        ValidationGroup="CreateUserWizard1">*</asp:CompareValidator>
                  </td>            
               </tr>
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblEmail" AssociatedControlID="Email" Text="E-mail(*):" /></td>
                  <td><asp:TextBox runat="server" ID="Email" Width="100%" Text='<%# Email %>' /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireEmail" runat="server" ControlToValidate="Email" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="B&#7855;t bu&#7897;c nh&#7853;p E-mail." ToolTip="B&#7855;t bu&#7897;c nh&#7853;p E-mail." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                     <asp:RegularExpressionValidator runat="server" ID="valEmailPattern"  Display="Dynamic" SetFocusOnError="true" ValidationGroup="CreateUserWizard1"
                        ControlToValidate="Email" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ErrorMessage="Email không &#273;úng &#273;&#7883;nh d&#7841;ng.">*</asp:RegularExpressionValidator>
                  </td>            
               </tr>
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblQuestion" AssociatedControlID="Question" Text="Câu h&#7887;i b&#7843;o m&#7853;t(*):" /></td>
                  <td><asp:TextBox runat="server" ID="Question" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireQuestion" runat="server" ControlToValidate="Question" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="B&#7855;t bu&#7897;c nh&#7853;p câu h&#7887;i b&#7843;o m&#7853;t." ToolTip="B&#7855;t bu&#7897;c nh&#7853;p câu h&#7887;i b&#7843;o m&#7853;t."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                  </td>            
               </tr>
               <tr>
                  <td class="fieldname"><asp:Label runat="server" ID="lblAnswer" AssociatedControlID="Answer" Text="Tr&#7843; l&#7901;i(*):" /></td>
                  <td><asp:TextBox runat="server" ID="Answer" Width="100%" /></td>
                  <td>
                     <asp:RequiredFieldValidator ID="valRequireAnswer" runat="server" ControlToValidate="Answer" SetFocusOnError="true" Display="Dynamic"
                        ErrorMessage="B&#7855;t bu&#7897;c nh&#7853;p tr&#7843; l&#7901;i." ToolTip="B&#7855;t bu&#7897;c nh&#7853;p tr&#7843; l&#7901;i."
                        ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator>
                  </td>            
               </tr>
               <tr>
                  <td colspan="3" style="text-align: right;">
                     <asp:Label ID="ErrorMessage" SkinID="FeedbackKO" runat="server" EnableViewState="False"></asp:Label>
                  </td>
               </tr>
            </table>
            <asp:ValidationSummary ValidationGroup="CreateUserWizard1" ID="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" />
            </ContentTemplate>
         </asp:CreateUserWizardStep>
         <asp:WizardStep runat="server" Title="Set preferences">
            <div class="sectiontitle">Thông tin ng&#432;&#7901;i dùng</div>           
            <p></p>
            <mb:UserProfile ID="UserProfile1" runat="server" />
         </asp:WizardStep>
         <asp:CompleteWizardStep runat="server"></asp:CompleteWizardStep>
      </WizardSteps>
      <MailDefinition
         BodyFileName="~/RegistrationMail.txt"
         From="admin@cungmuanao.com"
         Subject="cungmuanao.com : Thông tin tài khoản">
      </MailDefinition>
   </asp:CreateUserWizard>   
</asp:Content>      
